#pragma once

#include <Windows.h>

namespace Zaf {
namespace Mwl {
namespace __Internal {


class WndProcPicker {

public:
	WndProcPicker(const wchar_t* className) {

		WNDCLASS wndClass;
		GetClassInfo(GetModuleHandle(NULL), className, &wndClass);

		m_wndProc = wndClass.lpfnWndProc;
	}

	LRESULT operator()(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) {
		return ::CallWindowProc(m_wndProc, hwnd, message, wParam, lParam);
	}

private:
	WndProcPicker(const WndProcPicker&);
	const WndProcPicker& operator=(const WndProcPicker&);

	WNDPROC m_wndProc;
};



}
}
}